package com.hencoder.hencoderpracticedraw1.practice;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

public class Practice12Test1 extends View {

    public Practice12Test1(Context context) {
        super(context);
    }

    public Practice12Test1(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public Practice12Test1(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        myDraw(canvas);
    }

    private void myDraw(Canvas canvas) {
        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        paint.setStyle(Paint.Style.STROKE);
        paint.setStrokeWidth(5);

        Path path = new Path();
        path.moveTo(100, 100);
        path.lineTo(100, 500);
         path.rLineTo(100, 0);

        canvas.drawPath(path, paint);
    }
}
